<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>CSS布局技巧3</title>
    <style>
        .outer{
            width: 630px;
            height: 630px;
            background-color: gray;
            text-align: center;
            line-height: 630px;
            font-size: 0px; /* 干成0*/
        }
        img {
            vertical-align: middle;
        }
        span {
            font-size: 40px;
            vertical-align: middle;
            background-color: orange;
        }
    </style>
</head>
<body>
    <div class="outer">
        <span>x</span><img src="th.jfif"/>
    </div>
</body>
</html>